<div class="page-header">
    <h1>
        Form Ganti Password
        <small>
            <i class="icon-double-angle-right"></i>
            Ganti password Admin
        </small>
    </h1>
</div>

<?php
if ($this->msg) {
    ?>
    <div class="alert alert-danger">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>

        <strong>
            <i class="icon-remove"></i>
            Error
        </strong>

        <?php echo $this->msg; ?>
        <br />
    </div>
    <?php
}


if ($this->errmsg) {
    ?>
    <div class="alert alert-danger">
        <button type="button" class="close" data-dismiss="alert">
            <i class="icon-remove"></i>
        </button>

        <strong>
            <i class="icon-remove"></i>

        </strong>

        <?php echo $this->errmsg; ?>
        <br />
    </div>
<?php
}
?>


    <div class="row">
        <div class="col-xs-11">
            <form id="form" class="form-horizontal" role="form" action="" method="post" onsubmit="return cekPass()">
                
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="bank_id"> Password Lama </label>

                    <div class="col-sm-9">
                            <input type="password" id="oldPass" name="oldPass" placeholder="Password Lama" class="col-xs-10 col-sm-5" required />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right" for="bank_acc_name">Password Baru</label>
                    <div class="col-sm-9">
                        <input type="password" id="newPass" name="newPass" placeholder="Password Baru" class="col-xs-10 col-sm-5" required />
                </div>

            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right" for="bank_acc_no"> Ulangi Password Baru </label>

                <div class="col-sm-9">
                    <input type="password" id="newPass2" name="newPass2" placeholder="Ulangi Password Baru" class="col-xs-10 col-sm-5" required />
                </div>
            </div>
            
            
            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-success" type="submit">
                        <i class="icon-ok bigger-110"></i>
                        Submit
                    </button>

                    &nbsp; &nbsp; &nbsp;
                    <button class="btn" type="reset">
                        <i class="icon-undo bigger-110"></i>
                        Reset
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    function cekPass(){
        var newPass = $('#newPass').val();
        var newPass2 = $('#newPass2').val();

        if(newPass == newPass2) return true;
        else{
            alert("Password Baru tidak sama");
            return false;
        }
    }
</script>

